<script setup>
import { batch } from '~/logic/apis/taoCategory'

/**
 * @type ItemInterface
 */
const item = getCurrentInstance().proxy.$item

const category = ref({
  path: [],
})
const init = () => {
  console.log('category', item.cid());
  const id = item.cid()
  batch([id]).then((res) => {
    category.value = res.data.data[id] ?? {
      path: [],
    }
  })
}

onMounted(() => {
  setTimeout(() => {
    init()
  }, 1000)
})
</script>

<template>
  <a-row class="inner-box category-box">
    <a-col class="label">
      类目：
    </a-col>
    <a-col class="category-content blue bold" flex="1">
      <a-tooltip placement="top" color="#fff">
        <template #title>
          <span style="color: #444;line-height: 1">
            {{ category.path.join('/') }}</span>
        </template>
        {{ category.path.join('/') }}
      </a-tooltip>
    </a-col>
  </a-row>
</template>

<style scoped>

</style>
